<?php
$this->addTitle("Admistration - Navigation");
$this->body_tag.=" onload=\"show_list()\"";
echo "<h3>".$lang['admin']['nav_title']."</h3><br />";

echo "\n";
?>
<script type="text/javascript">
<?php $this->nav->javascriptArray("inhalt"); ?>

Zeile = 0;

function set(name){
	var wert = document.getElementById(name).value;
	document.getElementById(name).setAttribute("size", wert.length+5); 

	if(name.charAt(0)=="b"){
		var s = name.split("b");
		var t=s[1].split("|");
		inhalt[t[0]][t[1]]=wert;
	}else{
		var s = name.split("l");
		var t=s[1].split("|");
		inhalt[t[0]][2][t[1]][t[2]]=wert;
	}
}

function show_list(){



	if(Zeile>=0){
		for(r=Zeile;r>0;r--){
			document.getElementById("Tabelle").deleteRow(r-1);
		}
		Zeile=0;
	}
	
	for(i=0; i<inhalt.length; i++){
	
					


		var TR = document.getElementById("Tabelle").insertRow(Zeile);
		Zeile += 1;
		
		var TD1 = document.createElement("td");
			TD1.setAttribute("class","c");
			//var TD1text = document.createTextNode(inhalt[i][0]);
			var vd0  = document.createElement("input");
				vd0.setAttribute("class","textfeld");
				vd0.setAttribute("id","b"+i+"|0");
				vd0.setAttribute("value",inhalt[i][0]);
				vd0.setAttribute("size", inhalt[i][0].length+5);
				vd0.setAttribute("onkeyup", "set('"+"b"+i+"|0')");
			TD1.appendChild(vd0);
		var TD2 = document.createElement("td");
			var vd1  = document.createElement("input");
				vd1.setAttribute("class","textfeld");
				vd1.setAttribute("id","b"+i+"|1");
				vd1.setAttribute("value",inhalt[i][1]);
				vd1.setAttribute("size", inhalt[i][1].length+5);
				vd1.setAttribute("onkeyup", "set('"+"b"+i+"|1')");
			TD2.setAttribute("class","c");
			TD2.appendChild(vd1);
		var TD_empty0 = document.createElement("td");
			var TD_empty0_text = document.createTextNode("");
			TD_empty0.setAttribute("class","c");
			TD_empty0.appendChild(TD_empty0_text);	
		

		TR.appendChild(TD1);
		TR.appendChild(TD2);
		TR.appendChild(TD_empty0);

		
		for(j=0; j<inhalt[i][2].length; j++){
				var TR = document.getElementById("Tabelle").insertRow(Zeile);
				Zeile += 1;
				var TD1 = document.createElement("th");
					var vt0  = document.createElement("input");
						vt0.setAttribute("class","textfeld");
						vt0.setAttribute("id","l"+i+"|"+j+"|0");
						vt0.setAttribute("value",inhalt[i][2][j][0]);
						vt0.setAttribute("size",inhalt[i][2][j][0].length+5);
						vt0.setAttribute("onkeyup", "set('"+"l"+i+"|"+j+"|0')");
					TD1.appendChild(vt0);				
				var TD2 = document.createElement("th");
					var vt1  = document.createElement("input");
						vt1.setAttribute("class","textfeld");
						vt1.setAttribute("id","l"+i+"|"+j+"|1");
						vt1.setAttribute("value",inhalt[i][2][j][1]);
						vt1.setAttribute("size",inhalt[i][2][j][1].length+5);
						vt1.setAttribute("onkeyup", "set('"+"l"+i+"|"+j+"|1')");
					TD2.appendChild(vt1);
				
				var TD_empty1 = document.createElement("td");
				var TD_empty1_text = document.createTextNode("");
				TD_empty1.appendChild(TD_empty1_text);	

				TR.appendChild(TD_empty1);
				TR.appendChild(TD1);
				TR.appendChild(TD2);
		}
	}
}

</script>
<style type="text/css">
<!--
input {
	margin-top:4px;
	margin-bottom:2px;
}
-->
</style>




<a onclick="show_list()">klick</a>

<table id="Tabelle" width="100%" border="0" cellspacing="0" cellpadding="00">
		<tr>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
		</tr>

</table>


